*Replikationssyntax f�r Mader (2014): Grundhaltungen zur Au�en- und Sicherheitspolitik in Deutschland. In: Biehl/Schoen (Hrsg.)

*�ffnen des Datensatzes: GLES 2009 Langfrist-Online-Tracking, T14, ZA5347, Version 1.0.0
clear
use "...ZA5347_v1-0-0_numlabel.dta"
*Datenzugang �ber GESIS: http://www.gesis.org/en/elections-home/gles/data-and-documents/ 


*Datentrasfomration abh�ngige Variable: Zustimmung zu Bundeswehreinsatz in Afghanistan
generate Afgh1 = T14_003
mvdecode Afgh1, mv(98 = .a \ 99 = .b \ 110 = .c)
label variable Afgh1 "Unterst�tzung Afghanistan-Einsatz"
label define Afgh1_lb 1 "sofortiger Abzug der BW" 11 "weitere Stationierung der BW"
label val Afgh1 Afgh1_lb

generate Afgh1_help = T14_003
mvdecode Afgh1_help, mv(98 = .a \ 99 = .b \ 110 = .c)
gen Afgh1_r = (Afgh1_help - 1) / 10
label variable Afgh1_r "Unterst�tzung Afghanistan-Einsatz"
label define Afgh1_r_lb 0 "sofortiger Abzug der BW" 1 "weitere Stationierung der BW"
label val Afgh1_r Afgh1_5er_lb


recode T14_008a (1 = 5) (2 = 4) (3 = 3) (4 = 2) (5 = 1) (98 = 98) (99 = 99) (110 = 110), gen (Afgh2)
mvdecode Afgh2, mv(98 = .a \ 99 = .b \ 110 = .c)
label variable Afgh2 "Unterst�tzung Afghanistan-Einsatz, Item 2"
label define Afgh2_lb 1 "Stimme Abzug voll und ganz zu" 5 "Stimme Abzug �berhaupt nicht zu"
label val Afgh2 Afgh2_lb


gen Afgh2_r = (Afgh2 - 1) / 4
label variable Afgh2_r "Zustimmung Afghanistan-Abzug"
label define Afgh2_r_lb 0 "stimme voll und ganz zu" 1 "stimme �berhaupt nicht zu"
label val Afgh2_r Afgh2_r_lb


egen Afgh_ind_r = rowmean(Afgh1_r Afgh2_r)
label variable Afgh_ind_r "Afghanistan Index"
label define Afgh_ind_r_lb 0 "starke Ablehung" 1 "starke Unterst�tzung"
label val Afgh_ind_r Afgh_ind_r_lb



*Datentrasfomration abh�ngige Variable: T�tung Osama Bin Ladens

recode T14_006 (1 = 1) (2 = 0) (98 = 98) (99 = 99) (110 = 110), gen (Osama1)
mvdecode Osama1, mv(98 = .a \ 99 = .b \ 110 = .c)
label variable Osama1 "T�tung Osamas richtige Ma�nahme, Item 1"
label define Osama1_lb 0 "Falsch" 1 "Richtig"
label val Osama1 Osama1_lb


recode T14_008d (1 = 5) (2 = 4) (3 = 3) (4 = 2) (5 = 1) (98 = 98) (99 = 99) (110 = 110), gen (Osama2_help)
mvdecode Osama2_help, mv(98 = .a \ 99 = .b \ 110 = .c)
gen Osama2_r = (Osama2_help - 1) / 4
label variable Osama2_r "T�tung Osamas richtige Ma�nahme, Item 2"
label define Osama2_r_lb 0 "Gerichtsverfahren, nicht T�tung" 1 "T�tung, nicht Gerichtsverfahren"
label val Osama2_r Osama2_r_lb

egen Osama_ind_r = rowmean(Osama1 Osama2_r)
label variable Osama_ind_r "T�tung Osama Bin Ladens"
label define Osama_ind_r_lb 0 "starke Ablehung" 1 "starke Unterst�tzung"
label val Osama_ind_r Osama_ind_r_lb




*Datentransformation abh�ngige Variable: GASP

	generate gasp = E43a
	mvdecode gasp, mv(98 = .a \ 99 = .b \ 110 = .c)
	gen gasp_r = (gasp - 1) / 4
	label variable gasp_r "Einf�hrung GASP"
	label define gasp_r_lb 0 "starke Ablehung" 1 "starke Unterst�tzung"
	label val gasp_r gasp_r_lb


*Datentransformation abh�ngige Variable: Ausschluss Euro-Schuldner

	generate ausschluss = T10_170b
	mvdecode ausschluss, mv(98 = .a \ 99 = .b \ 110 = .c)
	gen ausschluss_r = (ausschluss - 1) / 4
	label variable ausschluss_r "Einf�hrung GASP"
	label define ausschluss_r_lb 0 "starke Ablehung" 1 "starke Unterst�tzung"
	label val ausschluss_r ausschluss_r_lb


*Datentransformation unabh�ngige Variablen: au�enpol Grundeinstellungen________________________________________________________________________________________________________________________________

	generate mili1 = T14_002a
	mvdecode mili1, mv(98 = .a \ 99 = .b \ 110 = .c)
	generate mili2 = T14_002f
	mvdecode mili2, mv(98 = .a \ 99 = .b \ 110 = .c)

	generate inter1 = T14_002b
	mvdecode inter1, mv(98 = .a \ 99 = .b \ 110 = .c)
	generate inter2 = T14_002e
	mvdecode inter2, mv(98 = .a \ 99 = .b \ 110 = .c)

	generate multi1 = T14_002d
	mvdecode multi1, mv(98 = .a \ 99 = .b \ 110 = .c)
	generate multi2 = T14_002g
	mvdecode multi2, mv(98 = .a \ 99 = .b \ 110 = .c)

	generate atla1 = T14_002c
	mvdecode atla1, mv(98 = .a \ 99 = .b \ 110 = .c)
	generate atla2 = T14_002h
	mvdecode atla2, mv(98 = .a \ 99 = .b \ 110 = .c)



	*Index: Militarismus
	recode mili1 (1=5)(2=4)(3=3)(4=2)(5=1)
	egen mili = rowmean(mili1 mili2)
	label variable mili "Pazifismus-Militarismus Index"
	label define mili 1 "Pazifist" 5 "Militarist"
	label val mili mili_lb

	
	*Index:Internationalismus
	recode inter1 (1=5)(2=4)(3=3)(4=2)(5=1)
	egen inter = rowmean(inter1 inter2)
	label variable inter "Isolationismus-Internationalismus Index"
	label define inter 1 "Isolationist" 5 "Internationalist"
	label val inter inter_lb

	
	**Index: Multilateralismus
	recode multi2 (1=5)(2=4)(3=3)(4=2)(5=1)
	egen multi = rowmean(multi1 multi2)
	label variable multi "Unilateralismus-Multilateralismus Index"
	label define multi 1 "Unilateralist" 5 "Multilateralist"
	label val multi multi _lb



	*Index: Atlantizismus
	recode atla2 (1=5)(2=4)(3=3)(4=2)(5=1)
	egen atla = rowmean(atla1 atla2)
	label variable atla "Atlantizismus Index"
	label define atla 1 "kein Atlantizist" 5 "Atlantizist"
	label val atla atla_lb


**PID
	recode A37 (1 = 5) (2 = 4) (3 = 3) (4 = 2) (5 = 1)

	*PID CDU/CSU
	gen pi_cducsu = A37 if A36 == 2  |  A36 == 3
	replace pi_cducsu = 0 if A36 == 4 | A36 == 5 | A36 == 6  | A36 == 7  | A36 == 801  | A36 == 808  | A36 == 997

	*PID FDP
	gen pi_fdp = A37 if A36 == 5
	replace pi_fdp = 0 if A36 == 2 | A36 == 3 | A36 == 4 | A36 == 6 | A36 == 7  | A36 == 801  | A36 == 808  | A36 == 997

	*PID SPD
	gen pi_spd = A37 if A36 == 4
	replace pi_spd = 0 if A36 == 2 | A36 == 3 | A36 == 5 | A36 == 6 | A36 == 7  | A36 == 801  | A36 == 808  | A36 == 997

	*PID Gruene
	gen pi_gruene = A37 if A36 == 6
	replace pi_gruene = 0 if A36 == 2 | A36 == 3 | A36 == 4 | A36 == 5 | A36 == 7  | A36 == 801  | A36 == 808  | A36 == 997

	*PID Linke
	gen pi_linke = A37 if A36 == 7
	replace pi_linke = 0 if A36 == 2 | A36 == 3 | A36 == 4 | A36 == 5 | A36 == 6 | A36 == 801  | A36 == 808  | A36 == 997

	*Regierungs-PI Dummy
	recode A36 (2 3 5 = 1) (4 6 7 801 808 997 = 0) (999 = .b) (1010 = .c), gen(pi_gov_dummy)
	tab1 pi_gov_dummy
	gen pi_gov = A37 if pi_gov_dummy == 1
	replace pi_gov = 0 if pi_gov_dummy == 0
	replace pi_gov = 999 if A36 == 999
	replace pi_gov = 1010 if A36 == 1010
	replace pi_gov = 0 if pi_gov_dummy == .
	mvdecode pi_gov, mv(999 = .b \ 1010 = .c)
	recode pi_gov (1 = 5)(2 = 4)(3 = 3)(4 = 2)(5 = 1)

	*PI Dummy
	recode A36 (2 3 4 5 6 7 801 = 1) (808 997 999 1010 = 0), gen(pi_dummy)



**Datentransformation unabh�ngige Variablen: allgemeine politische Grundhaltungen

	*Links-Rechts Dimension
	generate lire = A33
	mvdecode lire, mv(98 = .a \ 99 = .b \ 110 = .c)
	label variable lire "Links-Rechts Orientierung"
	label define lire_lb 1 "links" 11 "rechts"
	label val lire lire_lb


	
*Datentransformation unabh�ngige Variablen: Sozio-Demographie
	*Bildung Dummy
	recode v_03 (5=1) (1 2 3 4 6 = 0) (110 = 110), gen(edu_h_dummy)
	mvdecode edu_h_dummy, mv(110 = .c)
	label variable edu_h_dummy "Abitur Dummy"
	label define edu_h_dummy_lb 1 "Abitur" 0 "kein Abitur"
	label val edu_h_dummy edu_h_dummy_lb

	*Alter
	gen age = 2011 - v_02 
	recode age (-7999 = 110)
	mvdecode age, mv(110 = .c)

	*Weiblich
	recode v_01 (2 = 1) (1 = 0) (110 = 110), gen(female) 
	mvdecode female, mv(110 = .c)
	label define female_lb 0 "m�nnlich" 1 "weiblich"
	label val female female_lb

	*Herkunft
	recode A45 (3 = 1) (2 4 7 12 16 17 18 19 20 21 = 0) (99 = 99) (110 = 110), gen(ost)
	mvdecode ost, mv(99 = .b \ 110 = .c)
	tab1 ost, mis



**Korrektur des Wertebereichs auf 0-1
	foreach var of varlist mili mili1 mili2 inter inter1 inter2 multi multi1 multi2 atla atla1 atla2 {
	gen `var'_r = (`var' - 1)/4
	}
	
	foreach var of varlist pi_linke pi_gruene pi_spd pi_cducsu pi_fdp {
	gen `var'_r = `var' / 5
	}

	gen pi_gov_r = pi_gov/5

	gen age_r = (age - 18)/72

	gen edu_h_dummy_r = edu_h_dummy
	gen female_r = female
	gen ost_r = ost
	gen pi_gov_dummy_r = pi_gov_dummy
	gen Osama1_r = Osama1





**Beschreibung Grunddimensionen (Tabelle 2)
	sum mili_r
	sum inter2_r
	sum multi_r
	sum atla_r


**AV: Aussen- und sicherheitspolitische Grundhaltungen (Tabelle 3)

	*Militarismus
	reg mili_r pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r ///
	age_r edu_h_dummy_r female_r ost_r
	estat vif

	reg mili_r pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r
	estat vif

	*Internationalismus: inter2
	reg inter2_r pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r ///
	age_r edu_h_dummy_r female_r ost_r
	estat vif

	*Multilateralismus
	reg multi_r pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r ///
	age_r edu_h_dummy_r female_r ost_r
	estat vif

	*Atlantizismus
	reg atla_r pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r ///
	age_r edu_h_dummy_r female_r ost_r
	estat vif



**AV: Aussen- und sicherheitspolitische Sachfragen (Tabelle 4)

	*Afghanistan: Afgh_ind mit Grundhaltungen
	reg Afgh_ind_r mili_r inter2_r multi_r atla_r ///
	pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r ///
	age_r edu_h_dummy_r female_r ost_r
	estat vif


	*T�tung Osama Bin Ladens: Osama_ind mit Grundhaltungen
	reg Osama_ind_r mili_r inter2_r multi_r atla_r ///
	pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r ///
	age_r edu_h_dummy_r female_r ost_r
	estat vif


	**GASP mit Grundhaltungen
	reg gasp_r mili_r inter2_r multi_r atla_r ///
	pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r ///
	age_r edu_h_dummy_r female_r ost_r
	estat vif

	
	*Ausschluss Schulderl�nder mit Grundhaltungen
	reg ausschluss_r mili_r inter2_r multi_r atla_r ///
	pi_cducsu_r pi_spd_r pi_gruene_r pi_fdp_r pi_linke_r lire_r ///
	age_r edu_h_dummy_r female_r ost_r
	estat vif
